import datetime
import uuid
import os
from flask import current_app


def get_Ymd():
    return datetime.datetime.now().strftime('%Y-%m-%d')


def get_YmdHMS():
    return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')


def get_uuid():
    return str(uuid.uuid4()).split("'")[0]


def get_upload_path():
    return current_app.config['UPLOADED_FILES_DEST'] + get_Ymd() + '/'


def get_result_path():
    return current_app.config['RESULT'] + get_Ymd() + '/'


def is_exists(path):
    if not os.path.exists(path):
        os.makedirs(path)

